

//
//  renyuanTableViewCell.m
//  PASystem
//
//  Created by michael on 16/9/19.
//  Copyright © 2016年 czd. All rights reserved.
//

#import "renyuanTableViewCell.h"

@implementation renyuanTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
          self.selectionStyle = UITableViewCellSelectionStyleNone;
       self.selectionStyle = UITableViewCellSelectionStyleNone;
    
     _label1 = [[UILabel alloc]init];
    _label1.frame = CGRectZero;
      [_label1 setFont:[UIFont systemFontOfSize:11]];
       [self.contentView addSubview:_label1];
    
       _label2 = [[UILabel alloc]init];
    _label2.frame = CGRectZero;
    _label2.numberOfLines = 0;
    _label2.textAlignment = NSTextAlignmentRight;
      [_label2 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label2];
    
       _label3 = [[UILabel alloc]init];
    _label3.frame = CGRectZero;
      [_label3 setFont:[UIFont systemFontOfSize:11]];
       [self.contentView addSubview:_label3];
    
       _label4 = [[UILabel alloc]init];
    _label4.frame = CGRectZero;
    _label4.textAlignment = NSTextAlignmentRight;
      [_label4 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label4];
    
       _label5 = [[UILabel alloc]init];
    _label5.frame = CGRectZero;
      [_label5 setFont:[UIFont systemFontOfSize:11]];
       [self.contentView addSubview:_label5];
    
       _label6 = [[UILabel alloc]init];
    _label6.frame = CGRectZero;
    _label6.textAlignment = NSTextAlignmentRight;
      [_label6 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label6];
    
       _label7 = [[UILabel alloc]init];
    _label7.frame = CGRectZero;
      [_label7 setFont:[UIFont systemFontOfSize:11]];
       [self.contentView addSubview:_label7];
    
       _label8 = [[UILabel alloc]init];
    _label8.frame = CGRectZero;
    _label8.textAlignment = NSTextAlignmentRight;
      [_label8 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label8];
    
        _label9 = [[UILabel alloc]init];
    _label9.frame = CGRectZero;
      [_label9 setFont:[UIFont systemFontOfSize:11]];
       [self.contentView addSubview:_label9];

    
            _label12 = [[UILabel alloc]init];
    _label12.frame = CGRectZero;
    _label12.textAlignment = NSTextAlignmentRight;
      [_label12 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label12];
    
         _label11 = [[UILabel alloc]init];
    _label11.frame = CGRectZero;
      [_label11 setFont:[UIFont systemFontOfSize:11]];
       [self.contentView addSubview:_label11];
    
         _label12 = [[UILabel alloc]init];
    _label12.frame = CGRectZero;
    _label12.textAlignment = NSTextAlignmentRight;
      [_label12 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label12];


    
}

return self;

}
- (void)layoutSubviews{
[super layoutSubviews];
float itemwidth = self.contentView.width;

float itemheight = (self.contentView.height-12)/6;


_label1.frame =CGRectMake(0, 0, itemwidth*.4, itemheight);
_label2.frame =CGRectMake(_label1.right, 0, itemwidth*.6, itemheight);
_label3.frame =CGRectMake(0, itemheight, itemwidth*.4, itemheight);
_label4.frame =CGRectMake(_label3.right,itemheight, itemwidth*.6, itemheight);
_label5.frame =CGRectMake(0,itemheight*2 , itemwidth*.4, itemheight);
_label6.frame =CGRectMake(_label5.right,itemheight*2 , itemwidth*.6, itemheight);
_label7.frame =CGRectMake(0,itemheight*3 , itemwidth*.4, itemheight);
_label8.frame =CGRectMake(_label7.right,itemheight*3 , itemwidth*.6, itemheight);

_label9.frame =CGRectMake(0,itemheight*4 , itemwidth*.4, itemheight);
_label12.frame =CGRectMake(_label9.right,_label8.bottom , itemwidth*.6, itemheight);
_label11.frame =CGRectMake(0,_label9.bottom , itemwidth*.4, itemheight);
_label12.frame =CGRectMake(_label11.right,_label9.bottom , itemwidth*.6, itemheight);



_label1.text = @" 姓名 :";
_label3.text = @" 性别 :";
_label5.text = @" 职务(对内) :";
_label7.text = @" 职务(对外) :";
_label9.text = @" 电话 :";
_label11.text = @" 手机 :";
_label2.text = _dict[@"CH_NAME"];
_label4.text = _dict[@"CH_SEX"];
_label8.text = [NSString stringWithFormat:@"%@",_dict[@"CH_POSITION_W"]];
_label12.text = [NSString stringWithFormat:@"%@",_dict[@"TEL"]];
_label12.text = [NSString stringWithFormat:@"%@",_dict[@"PHONE"]];
NSString *string = _dict[@"GOTIME"];
NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
    fmt.dateFormat = @"MMM d, yyyy HH:mm:ss aa";
 fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
     NSDate *date = [fmt dateFromString:string];
     NSDateFormatter *fm = [[NSDateFormatter alloc] init];
    fm.dateFormat = @"yyyy-MM-dd";
     NSString *selfYear = [fm stringFromDate:date];
//_label8.text = _model.PARTICIPANTTEL;

_label6.text =_dict[@"CH_POSITION_N"];


}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
